﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Smile.Network.Http
{
    /// <summary>Interface to send basical http requests.</summary>
    ///
    /// <example>
    ///     IHttpRequest request = new HttpRequest();
    ///     var response = await request.GetAsync("http://www.kittyful.com");
    /// </example>
    public interface IHttpRequest
    {
        // @Public
        /// <summary>
        ///     Send a GET request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri">The Uri the request is sent to.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>
        Task<HttpResponse> GetAsync(string uri);

        /// <summary>
        ///     Send a GET request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri">The Uri the request is sent to.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>;
        Task<HttpResponse> GetAsync(Uri uri);

        /// <summary>
        ///     Send a POST request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri"> The Uri the request is sent to.</param>
        /// <param name="data">The data to be post.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>
        Task<HttpResponse> PostAsync(string uri, IDictionary<string, string> data);

        /// <summary>
        ///     Send a POST request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri"> The Uri the request is sent to.</param>
        /// <param name="data">The data to be post.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>
        Task<HttpResponse> PostAsync(Uri uri, IDictionary<string, string> data);

        /// <summary>
        ///     Send a PUT request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri"> The Uri the request is sent to.</param>
        /// <param name="data">The data to be post.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>
        Task<HttpResponse> PutAsync(string uri, IDictionary<string, string> data);

        /// <summary>
        ///     Send a PUT request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri"> The Uri the request is sent to.</param>
        /// <param name="data">The data to be post.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>
        Task<HttpResponse> PutAsync(Uri uri, IDictionary<string, string> data);
    }
}
